<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@page import="java.sql.ResultSet"%>
<%@page import="java.sql.*"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ page import="com.book.Dao.*"%>
<% 
SelectAllOrder sao=new SelectAllOrder();
ResultSet rs=sao.finyifahuo(2);
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <title>订单列表</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<meta http-equiv="content-type" content="text/html;charset=utf-8">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->
	<link rel="stylesheet" type="text/css" href="<c:url value='/qiantai/pager/pager.css'/>" />
    <script type="text/javascript" src="<c:url value='/qiantai/pager/pager.js'/>"></script>
    <link rel="stylesheet" type="text/css" href="<c:url value='/order/list.css'/>" />
    <link rel="stylesheet" type="text/css" href="<c:url value='/css/css.css'/>" />

  </head>
  
  <body>
<p class="pLink">
  <a href="<c:url value='WuiFaHuo.jsp'/>">未发货</a>  | 
  <a href="<c:url value='YiFaHuo.jsp'/>">已发货</a>  | 
</p>
<div style="width:100%;height:100%; overflow-y:scroll; border:1px solid;">
<div class="divMain">
	<div class="title">
		<div style="margin-top:7px;">
			<span style="margin-left: 150px;margin-right: 280px;">商品信息</span>
			<span style="margin-left: 40px;margin-right: 100px;">优惠金额</span>
			<span style="margin-left: 50px;margin-right: 53px;">订单状态</span>
			<span style="margin-left: 100px;">操作</span>
		</div>
	</div>
	<br/>
	<table align="center" border="0" width="100%" cellpadding="0" cellspacing="0">
	
	
	
	<% while(rs.next()){%>
		<tr class="tt">
			<td width="320px">订单号：<a  href="<c:url value='desc.jsp'/>"><%=rs.getString("ORDERID")%></a></td>
			<td width="200px">下单时间：<%=rs.getString("times")%></td>
			<td width="178px">&nbsp;</td>
			<td width="205px">&nbsp;</td>
			<td>&nbsp;</td>
		</tr>
		<tr style="padding-top: 10px; padding-bottom: 10px;">
			<td colspan="2">
     <% 
     String bookid=rs.getString("bookid");
     int bookprice=1;
     String bookname=null;
     String bookimg=null;
     
     Connection conn=null;
	   Statement stm=null;
	   ResultSet rs1=null;
	   String sql="select bookname,PRICE,BOOKIMG from book where bookid="+bookid+"";
	   try {
		Class.forName("oracle.jdbc.driver.OracleDriver");
		conn=DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:ORCL","scott","tiger");
		stm=conn.createStatement();
		rs1=stm.executeQuery(sql);
		while(rs1.next()){
			bookprice=rs1.getInt("PRICE");
			bookname=rs1.getString("bookname");
			bookimg=rs1.getString("BOOKIMG");
		}
	} catch (ClassNotFoundException e) {
		e.printStackTrace();
	} catch (SQLException e) {
		e.printStackTrace();
	}
     
     %>
	<img border="0" width="70" src="<%=bookimg%>"/>

			</td>
			<td style="padding-left: 0">
			<% int heji=rs.getInt("numbers")*bookprice;%>
				<span class="price_t">&yen;<%=heji%></span>
				<% String heji2= Integer.toString(heji);%>
			</td>
			<td>
				已发货
			</td>
			<td>
		   </td>
		</tr>
		
     <% 
	}%>
	</table>
	<br/>
</div>
</div>
  </body>
</html>

